<style type="text/css">
	table{
	   font-family: Arial;
       font-size: 10pt;
	}
	.titles{
		font-weight: bolder;
        background-color: #B1D6AB;
	}
    .cd{
        font-family: Arial; 
        font-size: 12pt;
    } 
    .cdinfo{
        font-family: Arial; 
        font-size: 12pt;
        color:#0080FF;
    }
    .ds{
        font-family: Arial;
         color:green; 
         font-size: 14pt; 
    }
    .drl{
        width:  38px;
        border-width: 0.5pt; 
		border: solid silver;
    }
    .sndy{
        width:  58px;
        border-width: 0.5pt; 
		border: solid silver;
    }
    .xl{
        width:  32px;
        border-width: 0.5pt; 
		border: solid silver;
        
    }
    .ghichu{
        width:  32px;
        border-width: 0.5pt; 
		border: solid silver;
        
    }
    .diemtbhk{
        width:  46px;
        border-width: 0.5pt; 
		border: solid silver;
        /*background-color: #B1D6AB;*/
    }
    .xs{
        width:  46px;
        border-width: 0.5pt; 
		border: solid silver;
        /*background-color: #B1D6AB;*/
    }
    .tb{
        width:  46px;
        border-width: 0.5pt; 
		border: solid silver;
        /*background-color: #B1D6AB;*/
    }
    .y{
        width:  46px;
        border-width: 0.5pt; 
		border: solid silver;
        /*background-color: #B1D6AB;*/
    }
    .k{
        width:  46px;
        border-width: 0.5pt; 
		border: solid silver;
        /*background-color: #B1D6AB;*/
    }
    .hoten{
        width:  140px;
        border-width: 0.5pt; 
		border: solid silver;
    }
    .mssv{
        width:  60px;
        border-width: 0.5pt; 
		border: solid silver;
    }
    .stt{
    width:  20px;
    border-width: 0.5pt; 
	border: solid silver;
    }
    .tieude{
		font-weight: bolder;
        background-color: #B1D6AB;
	}
</style>
    
<table cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="3">ĐOÀN TNCS HCM TRƯỜNG ĐẠI HỌC CẦN THƠ</td>
        <td></td>
        <td colspan="6">Cần Thơ, ngày <?php echo date("d");?> tháng <?php echo date("m");?> năm <?php echo date("Y");?></td>
    </tr>
    <tr>
        <td colspan="3">BCH ĐOÀN KHOA CÔNG NGHỆ TT&TT</td>
        <td></td>
        <td colspan="6"></td>
    </tr>
    <tr>
        <td colspan="4">Số: ….…./BC.ĐTN</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>    
        <td colspan="8" align="center">
            <center class="ds"><b>BÁO CÁO <br />
                 KẾT QUẢ PHÂN LOẠI ĐOÀN VIÊN, CHI ĐOÀN <br /></b></center>
        </td>    
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>    
        <td colspan="5" align="center"><center>
            Học kỳ: <?php echo substr($session->read('hockyht_ten'),0,1);?>
            - Năm học: <?php echo $session->read('namhocht_ten');?>
            </center>
        </td>    
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td colspan="5" align="center"><center>Kính gởi:	BCH Đoàn trường ĐH Cần Thơ</center></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td colspan="3" >Tổng số Chi Đoàn:  <?php echo count($chidoans);?></td>
        
        <td colspan="3">Số Chi Đoàn Cán Bộ:  <?php echo count($chidoancbs);?></td> 
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td>Kết quả phân loại</td>
        <td></td>   
        <td colspan="3">
            <?php echo "+ Xuất sắc:";?><br />
            <?php echo "+ Khá: ";?>
        </td>
        <td colspan="4">
            <?php echo "+ Trung bình: ";?><br />
            <?php echo "+ Yếu: ";?>
        </td>
        <td></td>    
        <td></td>     
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td colspan="2">- Số đoàn viên được bình xét Đoàn viên ưu tú:</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td colspan="2"><b>I. KẾT QUẢ PHÂN LOẠI ĐOÀN VIÊN:</b></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td colspan="2"><b>1. Chi Đoàn Cán Bộ:</b></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <?php 
        foreach($chidoancbs as $chidoan):
    ?>
    	<?php
        	$i = 0;
        	foreach ($phanloaicbs as $phanloaicb):
                if($phanloaicb['Chidoansv']['id']==$chidoan['Chidoansv']['id']):
            $i++;
        ?>
            <?php 
                if($i==1):		
        	?>
            <?php 
                foreach($loaicdcbs as $loaicdcb):
                if($loaicdcb['Loaicdcb']['chidoansv_id']==$chidoan['Chidoansv']['id']):
            ?>
            <tr>
            <td></td>
            <td colspan="2"><b><?php echo $phanloaicb['Chidoansv']['tenchidoan'];?></b></td>
            <td></td>
            <td colspan="2"><?php echo $loaicdcb['Xeploaicd']['loaicd'];break;?></td>
            <?php endif;?>
            <td></td>
            <td></td>
            </tr>
            <?php endforeach;?>
            
            <tr>    
                    <th class="stt" style="font-weight: bolder;background-color: #B1D6AB;" ><?php  __('STT');?></th>
                    <th class="hoten" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('Họ Tên');?></th>
        			<th class="mssv" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('MSCB');?></th>       
                    <th class="xs" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('XS');?></th>
                    <th class="tb" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('TB');?></th>
                    <td class="y" style="font-weight: bolder;background-color: #B1D6AB;" ><?php  __('Y');?></td>
                    <th class="k" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('K');?></th>
                    <th class="ghichu" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('Ghi Chú');?></th>
                    
        	</tr>
            <?php endif; ?>
        
    	<tr>
            <td class="stt"><?php echo $i;?></td>    
            <td class="hoten"><?php echo $phanloaicb['Z1plcb']['hoten']; ?></td>
            <td class="mssv"><?php echo $phanloaicb['Z1plcb']['mscb']; ?></td>
            <?php 
                    foreach($xeploais as $xeploai):
                    if($xeploai['Xeploai']['id']==$phanloaicb['Z1plcb']['xeploai_id']):
                    if($phanloaicb['Z1plcb']['xeploai_id']==1): 
            ?>
            <td class="xl">
    			<?php echo "X"?>
    		</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaicb['Z1plcb']['xeploai_id']==2):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaicb['Z1plcb']['xeploai_id']==3):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>        
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaicb['Z1plcb']['xeploai_id']==4):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>        
            <?php endif; ?>
            <?php endif; ?>
            <?php endforeach; ?>
            <td class="ghichu"><?php echo $phanloaicb['Z1plcb']['ghichu']; ?>&nbsp;</td>
    	</tr>
        <?php endif; ?>
        <?php endforeach; ?>
    <?php endforeach; ?>
    
    
   
        <tr>
        <td></td>
        <td colspan="2"><b>1. Chi Đoàn Sinh Viên:</b></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        </tr>
         <?php 
        foreach($chidoans as $chidoan):
        ?>
         <?php
            	$i = 0;//pr($phanloaisinhviens);exit;
            	foreach ($phanloaisinhviens as $phanloaisinhvien):
                    if($phanloaisinhvien['Chidoansv']['id']==$chidoan['Chidoansv']['id']):
                $i++;
            ?>
                <?php 
                    if($i==1):		
            	?>
                
            <?php 
                foreach($loaicdsinhviens as $loaicdsinhvien):
                if($loaicdsinhvien['Loaicdsinhvien']['chidoansv_id']==$chidoan['Chidoansv']['id']):
            ?>
            <tr>
                <td></td>
            <td colspan="2"><b><?php echo $phanloaisinhvien['Chidoansv']['tenchidoan'];?></b></td>
            <td></td>            
            <td colspan="2"><?php echo "Được xếp loại: ".$loaicdsinhvien['Xeploaicd']['loaicd'];break;?></td>
                <?php endif;?>
            <td></td>
            <td></td>
            <?php endforeach;?>
            
         </tr>
            <tr>    
                    <th class="stt" style="font-weight: bolder;background-color: #B1D6AB;" ><?php  __('STT');?></th>
                    <th class="hoten" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('Họ Tên');?></th>
        			<th class="mssv" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('MSSV');?></th>
                    <th class="drl" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('ĐRL');?></th>
                    <th class="diemtbhk" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('TBHK');?></th>       
                    <th class="xs" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('XS');?></th>
                    <th class="tb" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('TB');?></th>
                    <td class="y" style="font-weight: bolder;background-color: #B1D6AB;" ><?php  __('Y');?></td>
                    <th class="k" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('K');?></th>
                    <th class="ghichu" style="font-weight: bolder;background-color: #B1D6AB;" ><?php __('Ghi Chú');?></th>
                    
        	</tr>
            <?php endif; ?>
        
    	<tr>
            <td class="stt"><?php echo $i;?></td>    
            <td class="hoten"><?php echo $phanloaisinhvien['Z1phanloaisinhvien']['hoten']; ?></td>
            <td class="mssv"><?php echo $phanloaisinhvien['Z1phanloaisinhvien']['mssv']; ?></td>
            <td class="drl"><?php echo $phanloaisinhvien['Z1phanloaisinhvien']['diemrenluyen']; ?></td>
            <td class="diemtbhk"><?php echo $phanloaisinhvien['Z1phanloaisinhvien']['diemtbhk']; ?></td>
            
            <?php 
                    foreach($xeploais as $xeploai):
                    if($xeploai['Xeploai']['id']==$phanloaisinhvien['Z1phanloaisinhvien']['xeploai_id']):
                    if($phanloaisinhvien['Z1phanloaisinhvien']['xeploai_id']==1): 
            ?>
            <td class="xl">
    			<?php echo "X"?>
    		</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaisinhvien['Z1phanloaisinhvien']['xeploai_id']==2):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaisinhvien['Z1phanloaisinhvien']['xeploai_id']==3):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>        
            <td class="xl">&nbsp;</td>
            <?php elseif($phanloaisinhvien['Z1phanloaisinhvien']['xeploai_id']==4):?>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">&nbsp;</td>
            <td class="xl">
    			<?php echo "X";?>
    		</td>        
            <?php endif; ?>
            <?php endif; ?>
            <?php endforeach; ?>
            <td class="ghichu"><?php echo $phanloaisinhvien['Z1phanloaisinhvien']['ghichu']; ?>&nbsp;</td>
    	</tr>
        <?php endif; ?>
        <?php endforeach; ?>
    <?php endforeach;?>
</table>